<?php
class communication_email_log_1 extends Update_Model_Database_AbstractChange{

	protected $comment="Создание таблицы communication_email_log";

	public function up(){
		$sql='CREATE TABLE IF NOT EXISTS communication_email_log(
				id INT(11) NOT NULL AUTO_INCREMENT,
				`text` TEXT NOT NULL,
				subject TEXT NOT NULL,
				`from` TEXT NOT NULL,
				`to` TEXT NOT NULL,
				ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
				accept TINYINT(1) NOT NULL DEFAULT 1,
				PRIMARY KEY (id)
				)
				ENGINE = INNODB
				CHARACTER SET utf8
				COLLATE utf8_general_ci;';
		$this->db->query($sql);
	}

	public function down(){
		$sql='DROP TABLE IF EXISTS communication_email_log;';
		$this->db->query($sql);
	}

}